<?php

/*
=====================================================
 I-Soft Bizness - внедрение и модификация I-Soft
-----------------------------------------------------
 http://vkaragande.info/
-----------------------------------------------------
 Created by D.Madi
=====================================================
 Файл: stat.php
-----------------------------------------------------
 Назначение: Формирование статистики
=====================================================
*/
/*
if( ! defined( 'ISB' )) {
	die( "Hacking attempt!" );
}*/


if (!$_GET[id]) { 

$rstat1=$db->query ("select $db_stat.*,$db_users.* from $db_stat left join $db_users on $db_stat.firmselector=$db_users.selector WHERE $db_stat.firmselector!='0' ORDER BY $db_users.firmname");

 $results = $db->numrows ( $rstat1 );
?>

<div style="text-align: center"><? echo "$def_admin_stat<br>Сгенерирована: ".date("H:i:s"); ?><br /><br /></div>

<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td  id="table_files_b">Компания</td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
 <? for ( $i=0;$i<$results;$i++ )

 {$f = $db->fetcharray ( $r );
 ?> 
  <tr>
   <td  id="table_files_i"><a href="static.php?id=<?= $f['selector']?>" ><?= $f['firmname']?></a></td>
   <td  id="table_files_i"><?= $f['year']?></td>
   <td  id="table_files_i"><?= $f['m01']?></td>
   <td  id="table_files_i"><?= $f['m02']?></td>
   <td  id="table_files_i"><?= $f['m03']?></td>
   <td  id="table_files_i"><?= $f['m04']?></td>
   <td  id="table_files_i"><?= $f['m05']?></td>
   <td  id="table_files_i"><?= $f['m06']?></td>
   <td  id="table_files_i"><?= $f['m07']?></td>
   <td  id="table_files_i"><?= $f['m08']?></td>
   <td  id="table_files_i"><?= $f['m09']?></td>
   <td  id="table_files_i"><?= $f['m10']?></td>
   <td  id="table_files_i"><?= $f['m11']?></td>
   <td  id="table_files_i"><?= $f['m12']?></td>
   <td  id="table_files_i"><?= $f['counter']?></td>
  </tr>
 <?}?> 
</table>

<?}
else
{
 $idfirm=$_GET['id'];
$rstat1=$db->query ("select $db_stat.*,$db_users.* from $db_stat left join $db_users on $db_stat.firmselector=$db_users.selector WHERE $db_stat.firmselector='$idfirm'");
 $results = $db->numrows ( $rstat1 );
 $rstat2=$db->query ("select $db_statfirm.*,$db_offers.* from $db_statfirm left join $db_offers on $db_statfirm.id_info=$db_offers.num WHERE $db_statfirm.firmselector='$idfirm' and $db_statfirm.type_info='6'  ");
 $results_o = $db->numrows ( $rstat2 );
$rstat3=$db->query ("select $db_statfirm.*,$db_pages.* from $db_statfirm left join $db_pages on $db_statfirm.id_info=$db_pages.num WHERE $db_statfirm.firmselector='$idfirm'  and $db_statfirm.type_info='7' ");
 $results3 = $db->numrows ( $rstat3 );
 $rstat4=$db->query ("select $db_statfirm.*,$db_info.* from $db_statfirm left join $db_info on $db_statfirm.id_info=$db_info.num WHERE $db_statfirm.firmselector='$idfirm'  and $db_statfirm.type_info='1' ");
 $results4 = $db->numrows ( $rstat4 );
  $rstat5=$db->query ("select $db_statfirm.*,$db_info.* from $db_statfirm left join $db_info on $db_statfirm.id_info=$db_info.num  WHERE $db_statfirm.firmselector='$idfirm'  and $db_statfirm.type_info='2' ");
 $results5 = $db->numrows ( $rstat5 );
  $rstat6=$db->query ("select $db_statfirm.*,$db_info.* from $db_statfirm left join $db_info on $db_statfirm.id_info=$db_info.num  WHERE $db_statfirm.firmselector='$idfirm'  and $db_statfirm.type_info='3' ");
 $results6 = $db->numrows ( $rstat6 );
  $rstat7=$db->query ("select $db_statfirm.*,$db_info.* from $db_statfirm left join $db_info on $db_statfirm.id_info=$db_info.num  WHERE $db_statfirm.firmselector='$idfirm'  and $db_statfirm.type_info='4' ");
 $results7 = $db->numrows ( $rstat7 );  
 $rstat8=$db->query ("select $db_statfirm.*,$db_info.* from $db_statfirm left join $db_info on $db_statfirm.id_info=$db_info.num  WHERE $db_statfirm.firmselector='$idfirm'  and $db_statfirm.type_info='5' ");
 $results8 = $db->numrows ( $rstat8 );
 
 ?>

<div style="text-align: center"><? echo "$def_admin_stat<br>Сгенерирована: ".date("H:i:s"); ?><br /><br /></div>

<table width="1000" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td  id="table_files_b">Компания</td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
 <? 
 for ( $i=0;$i<$results;$i++ )

 {$f = $db->fetcharray ( $rstat1 );
 ?> 
  <tr>
   <td  id="table_files_i"><a href="static.php?id=<?= $f['selector']?>" ><?= $f['firmname']?></a></td>
   <td  id="table_files_i"><?= $f['year']?></td>
   <td  id="table_files_i"><?= $f['m01']?></td>
   <td  id="table_files_i"><?= $f['m02']?></td>
   <td  id="table_files_i"><?= $f['m03']?></td>
   <td  id="table_files_i"><?= $f['m04']?></td>
   <td  id="table_files_i"><?= $f['m05']?></td>
   <td  id="table_files_i"><?= $f['m06']?></td>
   <td  id="table_files_i"><?= $f['m07']?></td>
   <td  id="table_files_i"><?= $f['m08']?></td>
   <td  id="table_files_i"><?= $f['m09']?></td>
   <td  id="table_files_i"><?= $f['m10']?></td>
   <td  id="table_files_i"><?= $f['m11']?></td>
   <td  id="table_files_i"><?= $f['m12']?></td>
   <td  id="table_files_i"><?echo $s= $f['m01']+ $f['m01']+ $f['m02']+ $f['m03']+ $f['m04']+ $f['m05']+ $f['m06']+ $f['m07']+ $f['m08']+ $f['m09']+$f['m10']+ $f['m11'] +$f['m12'];?></td>
  </tr>
 <?}?> 
 
 <tr><td  id="table_files_b" colspan="15">Продукция</td></tr>
  <tr>
    <td  id="table_files_b">Продукция</td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
  <? 
 for ( $i=0;$i<$results_o;$i++ )

 {$f_o = $db->fetcharray ( $rstat2 );
 ?> 
  <tr>
   <td  id="table_files_i"><b><?= $f_o['item']?></b></td>
   <td  id="table_files_i"><?= $f_o['year']?></td>
   <td  id="table_files_i"><?= $f_o['m01']?></td>
   <td  id="table_files_i"><?= $f_o['m02']?></td>
   <td  id="table_files_i"><?= $f_o['m03']?></td>
   <td  id="table_files_i"><?= $f_o['m04']?></td>
   <td  id="table_files_i"><?= $f_o['m05']?></td>
   <td  id="table_files_i"><?= $f_o['m06']?></td>
   <td  id="table_files_i"><?= $f_o['m07']?></td>
   <td  id="table_files_i"><?= $f_o['m08']?></td>
   <td  id="table_files_i"><?= $f_o['m09']?></td>
   <td  id="table_files_i"><?= $f_o['m10']?></td>
   <td  id="table_files_i"><?= $f_o['m11']?></td>
   <td  id="table_files_i"><?= $f_o['m12']?></td>
   <td  id="table_files_i"><?echo $s= $f_o['m01']+ $f_o['m01']+ $f_o['m02']+ $f_o['m03']+ $f_o['m04']+ $f_o['m05']+ $f_o['m06']+ $f_o['m07']+ $f_o['m08']+ $f_o['m09']+$f_o['m10']+ $f_o['m11'] +$f_o['m12'];?></td>
 </tr>
 <?$s2 +=$s;?>
 <?}?>  
 <tr><td  id="table_files_i" colspan="14" align="right">Всего </td><td id="table_files_i"><?= $s2?></td></tr>
 
 <tr><td  id="table_files_b" colspan="15">Страницы</td></tr>
  <tr>
    <td  id="table_files_b">Страницы </td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
  <? 
 for ( $i=0;$i<$results3;$i++ )

 {$f_o = $db->fetcharray ( $rstat3 );
 ?> 
  <tr>
   <td  id="table_files_i"><b><?= $f_o['item']?></b></td>
   <td  id="table_files_i"><?= $f_o['year']?></td>
   <td  id="table_files_i"><?= $f_o['m01']?></td>
   <td  id="table_files_i"><?= $f_o['m02']?></td>
   <td  id="table_files_i"><?= $f_o['m03']?></td>
   <td  id="table_files_i"><?= $f_o['m04']?></td>
   <td  id="table_files_i"><?= $f_o['m05']?></td>
   <td  id="table_files_i"><?= $f_o['m06']?></td>
   <td  id="table_files_i"><?= $f_o['m07']?></td>
   <td  id="table_files_i"><?= $f_o['m08']?></td>
   <td  id="table_files_i"><?= $f_o['m09']?></td>
   <td  id="table_files_i"><?= $f_o['m10']?></td>
   <td  id="table_files_i"><?= $f_o['m11']?></td>
   <td  id="table_files_i"><?= $f_o['m12']?></td>
   <td  id="table_files_i"><?echo $s= $f_o['m01']+ $f_o['m01']+ $f_o['m02']+ $f_o['m03']+ $f_o['m04']+ $f_o['m05']+ $f_o['m06']+ $f_o['m07']+ $f_o['m08']+ $f_o['m09']+$f_o['m10']+ $f_o['m11'] +$f_o['m12'];?></td>
  </tr>
 <?$s3 +=$s;?>
 <?}?>  
 <tr><td  id="table_files_i" colspan="14" align="right">Всего </td><td id="table_files_i"><?= $s3?></td></tr>
 <tr><td  id="table_files_b" colspan="15">Новости</td></tr>
  <tr>
    <td  id="table_files_b">Новости </td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
  <? 
 for ( $i=0;$i<$results4;$i++ )

 {$f_o = $db->fetcharray ( $rstat4 );
 ?> 
  <tr>
   <td  id="table_files_i"><b><?= $f_o['item']?></b></td>
   <td  id="table_files_i"><?= $f_o['year']?></td>
   <td  id="table_files_i"><?= $f_o['m01']?></td>
   <td  id="table_files_i"><?= $f_o['m02']?></td>
   <td  id="table_files_i"><?= $f_o['m03']?></td>
   <td  id="table_files_i"><?= $f_o['m04']?></td>
   <td  id="table_files_i"><?= $f_o['m05']?></td>
   <td  id="table_files_i"><?= $f_o['m06']?></td>
   <td  id="table_files_i"><?= $f_o['m07']?></td>
   <td  id="table_files_i"><?= $f_o['m08']?></td>
   <td  id="table_files_i"><?= $f_o['m09']?></td>
   <td  id="table_files_i"><?= $f_o['m10']?></td>
   <td  id="table_files_i"><?= $f_o['m11']?></td>
   <td  id="table_files_i"><?= $f_o['m12']?></td>
  <td  id="table_files_i"><?echo $s= $f_o['m01']+ $f_o['m01']+ $f_o['m02']+ $f_o['m03']+ $f_o['m04']+ $f_o['m05']+ $f_o['m06']+ $f_o['m07']+ $f_o['m08']+ $f_o['m09']+$f_o['m10']+ $f_o['m11'] +$f_o['m12'];?></td>
  </tr>
 <?$s4 +=$s;?>
 <?}?>  
 <tr><td  id="table_files_i" colspan="14" align="right">Всего </td><td id="table_files_i"><?= $s4?></td></tr> 
 <tr><td  id="table_files_b" colspan="15">Статьи</td></tr>
  <tr>
    <td  id="table_files_b">Статьи </td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
  <? 
 for ( $i=0;$i<$results5;$i++ )

 {$f_o = $db->fetcharray ( $rstat5 );
 ?> 
  <tr>
   <td  id="table_files_i"><b><?= $f_o['item']?></b></td>
   <td  id="table_files_i"><?= $f_o['year']?></td>
   <td  id="table_files_i"><?= $f_o['m01']?></td>
   <td  id="table_files_i"><?= $f_o['m02']?></td>
   <td  id="table_files_i"><?= $f_o['m03']?></td>
   <td  id="table_files_i"><?= $f_o['m04']?></td>
   <td  id="table_files_i"><?= $f_o['m05']?></td>
   <td  id="table_files_i"><?= $f_o['m06']?></td>
   <td  id="table_files_i"><?= $f_o['m07']?></td>
   <td  id="table_files_i"><?= $f_o['m08']?></td>
   <td  id="table_files_i"><?= $f_o['m09']?></td>
   <td  id="table_files_i"><?= $f_o['m10']?></td>
   <td  id="table_files_i"><?= $f_o['m11']?></td>
   <td  id="table_files_i"><?= $f_o['m12']?></td>
  <td  id="table_files_i"><?echo $s= $f_o['m01']+ $f_o['m01']+ $f_o['m02']+ $f_o['m03']+ $f_o['m04']+ $f_o['m05']+ $f_o['m06']+ $f_o['m07']+ $f_o['m08']+ $f_o['m09']+$f_o['m10']+ $f_o['m11'] +$f_o['m12'];?></td>
  </tr>
 <?$s5 +=$s;?>
 <?}?>  
 <tr><td  id="table_files_i" colspan="14" align="right">Всего </td><td id="table_files_i"><?= $s5?></td></tr> 
 <tr><td  id="table_files_b" colspan="15">Обьявления</td></tr>
  <tr>
    <td  id="table_files_b">Обьявления </td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
  <? 
 for ( $i=0;$i<$results6;$i++ )

 {$f_o = $db->fetcharray ( $rstat6 );
 ?> 
  <tr>
   <td  id="table_files_i"><b><?= $f_o['item']?></b></td>
   <td  id="table_files_i"><?= $f_o['year']?></td>
   <td  id="table_files_i"><?= $f_o['m01']?></td>
   <td  id="table_files_i"><?= $f_o['m02']?></td>
   <td  id="table_files_i"><?= $f_o['m03']?></td>
   <td  id="table_files_i"><?= $f_o['m04']?></td>
   <td  id="table_files_i"><?= $f_o['m05']?></td>
   <td  id="table_files_i"><?= $f_o['m06']?></td>
   <td  id="table_files_i"><?= $f_o['m07']?></td>
   <td  id="table_files_i"><?= $f_o['m08']?></td>
   <td  id="table_files_i"><?= $f_o['m09']?></td>
   <td  id="table_files_i"><?= $f_o['m10']?></td>
   <td  id="table_files_i"><?= $f_o['m11']?></td>
   <td  id="table_files_i"><?= $f_o['m12']?></td>
 <td  id="table_files_i"><?echo $s= $f_o['m01']+ $f_o['m01']+ $f_o['m02']+ $f_o['m03']+ $f_o['m04']+ $f_o['m05']+ $f_o['m06']+ $f_o['m07']+ $f_o['m08']+ $f_o['m09']+$f_o['m10']+ $f_o['m11'] +$f_o['m12'];?></td>
  </tr>
 <?$s6 +=$s;?>
 <?}?>  
 <tr><td  id="table_files_i" colspan="14" align="right">Всего </td><td id="table_files_i"><?= $s6?></td></tr>
 <tr><td  id="table_files_b" colspan="15">Вакансии</td></tr>
  <tr>
    <td  id="table_files_b">Вакансии </td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
  <? 
 for ( $i=0;$i<$results7;$i++ )

 {$f_o = $db->fetcharray ( $rstat7 );
 ?> 
  <tr>
   <td  id="table_files_i"><b><?= $f_o['item']?></b></td>
   <td  id="table_files_i"><?= $f_o['year']?></td>
   <td  id="table_files_i"><?= $f_o['m01']?></td>
   <td  id="table_files_i"><?= $f_o['m02']?></td>
   <td  id="table_files_i"><?= $f_o['m03']?></td>
   <td  id="table_files_i"><?= $f_o['m04']?></td>
   <td  id="table_files_i"><?= $f_o['m05']?></td>
   <td  id="table_files_i"><?= $f_o['m06']?></td>
   <td  id="table_files_i"><?= $f_o['m07']?></td>
   <td  id="table_files_i"><?= $f_o['m08']?></td>
   <td  id="table_files_i"><?= $f_o['m09']?></td>
   <td  id="table_files_i"><?= $f_o['m10']?></td>
   <td  id="table_files_i"><?= $f_o['m11']?></td>
   <td  id="table_files_i"><?= $f_o['m12']?></td>
   <td  id="table_files_i"><?echo $s= $f_o['m01']+ $f_o['m01']+ $f_o['m02']+ $f_o['m03']+ $f_o['m04']+ $f_o['m05']+ $f_o['m06']+ $f_o['m07']+ $f_o['m08']+ $f_o['m09']+$f_o['m10']+ $f_o['m11'] +$f_o['m12'];?></td>
  </tr>
 <?$s7 +=$s;?>
 <?}?>  
 <tr><td  id="table_files_i" colspan="14" align="right">Всего </td><td id="table_files_i"><?= $s7?></td></tr>  <tr><td  id="table_files_b" colspan="15">Пресс-релизы</td></tr>
  <tr>
    <td  id="table_files_b">Пресс-релизы </td>
    <td id="table_files_bc">Год</td>
    <td  id="table_files_b">Январь</td>
    <td  id="table_files_b">Февраль</td>
    <td  id="table_files_b">Март</td>
    <td  id="table_files_b">Апрель</td>
    <td  id="table_files_b">Май</td>
    <td  id="table_files_b">Июнь</td>
    <td  id="table_files_b">Июль</td>
    <td  id="table_files_b">Август</td>
    <td  id="table_files_b">Сентябрь</td>
    <td  id="table_files_b">Октябрь</td>
    <td  id="table_files_b">Ноябрь</td>
    <td  id="table_files_b">Декабрь</td>
    <td  id="table_files_b">Всего</td>
  </tr>
  <? 
 for ( $i=0;$i<$results8;$i++ )

 {$f_o = $db->fetcharray ( $rstat8 );
 ?> 
  <tr>
   <td  id="table_files_i"><b><?= $f_o['item']?></b></td>
   <td  id="table_files_i"><?= $f_o['year']?></td>
   <td  id="table_files_i"><?= $f_o['m01']?></td>
   <td  id="table_files_i"><?= $f_o['m02']?></td>
   <td  id="table_files_i"><?= $f_o['m03']?></td>
   <td  id="table_files_i"><?= $f_o['m04']?></td>
   <td  id="table_files_i"><?= $f_o['m05']?></td>
   <td  id="table_files_i"><?= $f_o['m06']?></td>
   <td  id="table_files_i"><?= $f_o['m07']?></td>
   <td  id="table_files_i"><?= $f_o['m08']?></td>
   <td  id="table_files_i"><?= $f_o['m09']?></td>
   <td  id="table_files_i"><?= $f_o['m10']?></td>
   <td  id="table_files_i"><?= $f_o['m11']?></td>
   <td  id="table_files_i"><?= $f_o['m12']?></td>
   <td  id="table_files_i"><?echo $s= $f_o['m01']+ $f_o['m01']+ $f_o['m02']+ $f_o['m03']+ $f_o['m04']+ $f_o['m05']+ $f_o['m06']+ $f_o['m07']+ $f_o['m08']+ $f_o['m09']+$f_o['m10']+ $f_o['m11'] +$f_o['m12'];?></td>
  </tr>
 <?$s8 +=$s;?>
 <?}?>  
 <tr><td  id="table_files_i" colspan="14" align="right">Всего </td><td id="table_files_i"><?= $s8?></td></tr> 
  
  
</table>
 
 
 <?
}
?>
